Field of the Invention
The present invention relates to the field of markup language processing and more particularly to extensible markup language (XML) path (XPATH) expression traversal of an XML document.
Description of the Related Art
XML is a markup language specification widely credited with improving the functionality of the World Wide Web by allowing the identification of information in a more accurate, flexible, and adaptable way. XML is referred to as “extensible” because XML is not a fixed format like the hypertext markup language (HTML) which is a single, predefined markup language. Rather, XML is a meta-language that describes other languages. As such, XML allows for the design of other markup languages for virtually limitless different types of documents. XML can act as a meta-language because XML is written according to the standardized general markup language (SGML)—the international standard meta-language for text document markup.
There are several methods for processing an XML document. In one method, every clause in the XML document is accounted for and a hierarchical model can be constructed reflecting the interrelationships between the clauses of the XML document. Referred to as a document object model (DOM), the DOM tree once in memory can be traversed at will in order to manipulate the XML document. Another method provides for the event-driven serial parsing of clauses in an XML document. Referred to as “SAX” parsing—an acronym for simple application programming interface (API) for XML—consumes a significantly smaller memory footprint than DOM processing as an entire hierarchical model in the form of a DOM tree need not be constructed prior to processing the XML document.
The XPATH language defines expressions for traversing a DOM for an XML document and specifies the set of nodes or the sequence of nodes in an XML document. An XPATH expression, when evaluated by XPATH expression processing logic, can traverse the DOM for an XML document in steps from node to node until a targeted set of nodes or a sequence of nodes is produced. Once the result is produced, the intermediate nodes associated with the requisite XPATH steps are totally forgotten. The intermediate steps, however, express how an XPATH expression is evaluated for a particular XML document. Thus, the intermediate nodes can be important in debugging the effectiveness of an XPATH expression.